/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUI;

import java.awt.Graphics;
import java.awt.image.BufferedImage;

/**
 *
 * @author Snowangelic
 */
public class ActorLayer extends Layer {

    public ActorLayer(){
        super();
    }

    @Override
    void updateLayer(){
        if(!eventList.isEmpty()){
            LayerEvent event=eventList.lastElement();
            eventList.clear();
            updateImage(event.getImage(),event.getX(),event.getY());
        }
    }

    @Override
    protected void updateImage(BufferedImage newImage,int x,int y){
        layerImage = new BufferedImage(640,480,BufferedImage.TYPE_INT_ARGB);
        Graphics g=layerImage.getGraphics();
        g.drawImage(newImage,x,y,null);
    }
}
